<template>
	<div class="">
		<van-nav-bar title="个人中心" left-arrow @click-left="goBack" />

		<div class="home-page">
			<van-cell
				:title="item.title"
				is-link
				v-for="item in list"
				:key="item.id"
				:url="item.path"
			/>
		</div>
	</div>
</template>

<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
const list = ref([
	{
		id: 1,
		title: "管理单词本",
		path: "/WordBooks",
	},
	{
		id: 3,
		title: "上传文档",
		path: "/UploadPdf",
	},
	{
		id: 4,
		title: "个人信息",
		path: "/Profile",
	},
	{
		id: 5,
		title: "图书商城",
		path: "/Category",
	},
	{
		id: 6,
		title: "我的购物车",
		path: "/Cart",
	},
	{
		id: 7,
		title: "我的收货地址",
		path: "/Position",
	},
	{
		id: 8,
		title: "我的订单",
		path: "/Order",
	},
	{
		id: 9,
		title: "发布扩展阅读",
		path: "/PublicExtendActicle",
	},
	{
		id: 10,
		title: "退出",
		path: "/login",
	},
]);
const selectedWordbook = ref({
	name: "默认单词本",
	img: "default-cover.jpg",
	plan: "10",
});
const planOptions = ["10", "20", "30"];
const selectedPlanText = ref(
	"学习计划：" + selectedWordbook.value.plan + "个单词"
);
const router = useRouter();

const goBack = () => {
	router.back();
};
const startLearning = () => {
	console.log("开始学习:", selectedWordbook.value.name);
};

const manageWordbooks = () => {
	router.push("/WordBooks");
};

const showPlanPicker = () => {
	const planPicker = ref("planPicker");
	if (planPicker.value) {
		planPicker.value.show();
	}
};

const updatePlan = value => {
	selectedWordbook.value.plan = value;
	selectedPlanText.value = "学习计划：" + value + "个单词";
};
const books = ref([
	{
		name: "111",
		summary: "jwij",
	},
]);
</script>

<style scoped>
.home-page {
	padding: 10px;
}
</style>
